import os


basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


class Config(object):
    FLASK_WEB_NAME = '后台管理'
    SECRET_KEY = os.environ.get('SECRET_KEY') or '!@#$%^&*12345678'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    DEBUG_TB_INTERCEPT_REDIRECTS = False
    POST_PRE_PAGE = 20
    WTF_I18N_ENABLED = False

    CKEDITOR_ENABLE_CSRF = True
    CKEDITOR_FILE_UPLOADER = 'article.upload_image'
    CKEDITOR_HEIGHT = 400
    CKEDITOR_PKG_TYPE = 'full'

    BLUELOG_UPLOAD_PATH = os.path.join(basedir, 'uploads')

    OSS_BUCKET_URL = 'https://lsol-house-upload.oss-cn-hangzhou.aliyuncs.com'
    OSS_ACCESS_KEY_ID = 'LTAIR60T34HyDd0V'
    OSS_ACCESS_KEY_SECRET = 'wu7XoSMuSry4H5GEyjXjK87tnPY9uh'
    OSS_END_POINT = 'http://oss-cn-hangzhou.aliyuncs.com'
    OSS_BUCKET = 'lsol-house-upload'


class DevelopmentConfig(Config):
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')


class ProductionConfig(Config):
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')


config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
}
